import request from '@/utils/request'
import type { PromotionManagementType } from './types/PromotionManagement'

export function getPromotionManagementList() {
    return request<PromotionManagementType>({
        method:'get',
        url:'/system/promotion'
    })
  }


  export function putPromotionManagementList(data:any) {
    console.log(data);
    
    if (data.newer_promotion==0) {
      data.newer_promotion=10
    }
    if (data.order_discount==0) {
      data.order_discount=10
    }
    return request<PromotionManagementType>({
        method:'put',
        url:'/system/promotion',
        data:data
    })
  }

